@extends('system.frame_layout')
<?php
$parent_menu = "财务中心";
if ($flag == 1) {
    $menu_selected = "会员报单";
} elseif ($flag == 2) {
    $menu_selected = "已报单会员";
} elseif ($flag == 3) {
    $menu_selected = "我的推荐会员";
}
?>

@section('content')
    <div id="content-panel">
        <div class="row">
            <div class="col-xs-12">
                <div class="portlet light bordered">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="icon-social-dribbble font-dark hide"></i>
                            <span class="caption-subject font-dark bold">会员列表 </span>
                        </div>
                    </div>
                    <div class="portlet-body">
                        <table class="table table-hover table-responsive">
                            <thead>
                            <tr>
                                <th> 会员编号</th>
                                <th> 会员用户名</th>
                                <th> 会员等级</th>
                                <th> 节点人</th>
                                <th> 节点位置</th>
                                <th> 推荐人</th>
                                <th> 状态</th>
                                <th> 注册时间</th>
                                <th> 管理</th>
                            </tr>
                            </thead>
                            <tbody>
                            @foreach($users as $user)
                                <tr>
                                    <td>{{$user->no}}</td>
                                    <td>{{$user->username}}</td>
                                    <td>
                                        @if($user->vip == 0)
                                            普通用户
                                        @elseif($user->vip == 1)
                                            铜卡会员
                                        @elseif($user->vip == 2)
                                            银卡会员
                                        @elseif($user->vip == 3)
                                            金卡会员
                                        @elseif($user->vip == 4)
                                            钻卡会员
                                        @endif
                                    </td>
                                    <td>{{$user->nuser->username or "无"}}</td>
                                    <td>
                                        @if($user->addr == \App\Models\MUser::$ADDR_A)
                                            A区
                                        @elseif($user->addr == \App\Models\MUser::$ADDR_B)
                                            B区
                                        @endif
                                    </td>
                                    <td>{{$user->puser->username or "无"}}</td>
                                    <td>
                                        {{uStatusStr($user->status)}}
                                    </td>
                                    <td>{{date("Y-m-d",$user->reg_time)}}</td>
                                    <td>
                                        @if($user->ok_status == \App\Models\MUser::$STATUS_NOACTIVATED)
                                            <a class="btn blue btn-sm"
                                               href="{{route('sys.users.activation',['id'=>$user->id])}}">激活</a>
                                            <a class="btn blue btn-sm"
                                               href="{{route('sys.users.del',['id'=>$user->id])}}">删除</a>
                                        @endif
                                    </td>
                                </tr>
                            @endforeach
                            </tbody>
                        </table>
                        @include('system.coms.fenye')
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@section('footer')
@endsection